New.php
<?php
namespace Tlf\Tester\Test;
class NewTests extends \Tlf\Tester {
public function testNewCliRunTest(){
$dir = dirname(__DIR__).'/extra/';
$cli = new \Tlf\Tester\NewCli($dir);
$testResults = array_values($cli->run());
$result = $testResults[0]['\Taeluf\Tester\Test\SubTest\Test']['tests'];
$this->compare(
1,
$result['_testsRun']
);
$this->compare(
1,
$result['_testsPassing']
);
}
public function testNewCli(){
$dir = dirname(__DIR__).'/extra/';
$argv = [$dir, '-config', 'value', '--boolConfig', 'false', '--anotherBoolConfig', '-key', 'value2'];
$cli = new \Tlf\Tester\NewCli($dir, array_slice($argv,1));
$this->test('Inputs');
$inputs = $cli->getInputs();
$this->compare(
array_merge(
$cli->getDefaultInputs(),
[
'config'=>'value',
'boolConfig'=>false,
'anotherBoolConfig'=>true,
'key'=>'value2',
],
),
$inputs
);
$this->test('Configs');
$this->compare(
array_merge(
$cli->getDefaultConfigs(),
[
'file.autoloader'=>'../../vendor/autoload.php',
],
),
$cli->getConfigs(),
);
}
}